package com.sino.tb.confirm.entiry;

import java.sql.*;
import xpubbean.Db.*;
import java.util.*;

public class InvoiceCodeByName {
	private static Hashtable htInvoice = new Hashtable();

	static {
		Connection conn = null;
		try {
			conn = new Conn().getConnection();
			String sql = "select * from t_invoice order by c_code";
			ResultSetPlus rs = new ResultSetPlus(sql, conn);
			while (rs.next()) {
				htInvoice.put(rs.getFieldStr("c_code"), rs.getFieldStr("c_name"));
			}

		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				conn.close();
			} catch (Exception ex) {
			}
		}
	}

	public static String getInvoiceName(String code) {
		return (String) htInvoice.get(code);
	}
}
